/**
@C++ Standard: 11
@Copyright:Copyright (c) 2019 Harold Hu. All rights reserved.
@Author: Created by Harold Hu with CLion on 2019/1/12 10:43.
@File Name: GTEST_MAIN.cpp
@Description: For googleTest Framework.
*/
#include "HaroldDebug.h"

#if TEST_TYPE == TEST_GTEST

#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "glog/logging.h"

GTEST_API_ int main(int argc, char** argv)
{
	DEBUG_ENTER_OUT
	/* HOME_PATH */
	string home = "/mnt/g/CODE/DebugLog/";
	/* glog init */
	google::InitGoogleLogging(argv[0]);
	google::SetLogFilenameExtension("log_");
	string info_log = home + "master_info_";
	google::SetLogDestination(google::INFO, info_log.c_str());
	string warning_log = home + "master_warning_";
	google::SetLogDestination(google::WARNING, warning_log.c_str());
	string error_log = home + "master_error_";
	google::SetLogDestination(google::ERROR, error_log.c_str());
	string fatal_log = home + "master_fatal_";
	google::SetLogDestination(google::FATAL, fatal_log.c_str());
	testing::InitGoogleTest(&argc, argv);
	testing::InitGoogleMock(&argc, argv);
	LOG(INFO) << "Hello Glog";
	//	LOG(WARNING) << "warning";
	//	LOG(ERROR) << "error!!!";
	//	LOG(FATAL) << "fatal!!!";
//	::remove("/mnt/g/CODE/DebugLog/Harold.INFO");
	google::ShutdownGoogleLogging();
	return RUN_ALL_TESTS();
}

#endif